﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

namespace com.dbo
{
    public class QType
    {
        com.net.QType p = new com.net.QType();
        public QType()
        {
        }
        public QType(com.net.QType data)
        {
            p = data;
        }
        public com.net.QType Data
        {
            get { return p; }
            set { p = value; }
        }

        public bool Add()
        {
            SqlCommand cmd = com.dbo.DB.getCmdSp("addqtype");

            cmd.Connection.Open();
            cmd.Parameters.AddWithValue("qtypeid", p.QtypeID);
            cmd.Parameters.AddWithValue("qtype", p.QuestionType);

            int i = cmd.ExecuteNonQuery();
            cmd.Connection.Close();
            return i == 1;
        }
    }
}
